package com.zzyl.controller.customer;

import com.zzyl.base.ResponseResult;
import com.zzyl.dto.UserLoginRequestDto;
import com.zzyl.service.WechatService;
import com.zzyl.vo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "微信用户端登录管理")
@RestController
@RequestMapping("/customer/user")
@RequiredArgsConstructor
public class CustomerLoginController {
    private final WechatService wechatService;
    @PostMapping("/login")
    @ApiOperation(value = "微信登录验证")
    public ResponseResult<?> login(@RequestBody UserLoginRequestDto userLoginRequestDto){
        System.out.println("userLoginRequestDto = " + userLoginRequestDto);
        LoginVo loginVo =wechatService.login(userLoginRequestDto);
        return ResponseResult.success(loginVo);
    }
}
